"""
URL configuration for djangoProject project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.1/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, re_path
from django.conf.urls import include
from . import views, testdb, search

urlpatterns = [
    path('admin/', admin.site.urls),

    # 必选参数route —— 定义路径部分,可以包含路径部分
    # view 视图函数,处理与给定路由匹配的请求
    # kwargs 可选参数,包含给视图函数的额外关键字参数
    # name 为路径指定一个唯一的名称,以便被引用
    # path('hello' ,view.hello),
    path('runoob/', views.runoob),
    path('testdb/', testdb.testdb),

    path('updatedb/', testdb.update),

    path('search-form/', search.search_form),
    path('search/', search.search),

    path('search-post/',search.search_post),

    re_path("^index/([0-9]{4})/$", views.index),

    path("login1/", views.login, name="login"),

    path('app01/',include('app01.urls')),

    path('add_user/', views.add_user),

    path("login/", views.login, name="login"),
    path("get_valid_img/", views.get_valid_img, name="get_valid_img"),  # 生成验证码
]
